PUBLIC = ../../public
SRC = src
BIN = bin/debug
GLOBAL_BIN = ../../bin
CFLAGS = -Wall -pedantic -ansi -Werror -D_GNU_SOURCE
CC = gcc
LIB_TOOL = ar
LIB_FLAGS = -r -s
COMPILE_FLAG = -c

all: release 

debug: CFLAGS+=-g 
debug: BIN=bin/debug
debug: GLOBAL_BIN=../../bin/debug
debug: $(BIN)/process1  $(BIN)/process2 clean
	@echo "**********************************************************"
	@echo "*							*"
	@echo "*		SUCCEFULY FINISHED			*"
	@echo "*							*"
	@echo "**********************************************************"


release: CFLAGS+=-DNDEBUG
release: BIN=bin/release
release: GLOBAL_BIN=../../bin/release
release: $(BIN)/process1 $(BIN)/process2 clean
	@echo "**********************************************************"
	@echo "*							*"
	@echo "*		SUCCEFULY FINISHED			*"
	@echo "*							*"
	@echo "**********************************************************"

$(BIN)/process1: process1.o
	$(CC) $(CFLAGS) process1.o -o $(BIN)/process1

$(BIN)/process2: process2.o
	$(CC) $(CFLAGS) process2.o -o $(BIN)/process2



process1.o: process1.c
	$(CC) $(COMPILE_FLAG) $(CFLAGS) -I$(PUBLIC) process1.c -o process1.o

process2.o: process2.c
	$(CC) $(COMPILE_FLAG) $(CFLAGS) -I$(PUBLIC) process2.c -o process2.o


Exec:
	touch $(BIN)Test.scr;\
	echo "#!/bin/bash" > Test.scr; \
	echo ./$(BIN)/process1 Yehuda Roth\&\ >>Test.scr; \
	echo ./$(BIN)/process2\&\ >>Test.scr; \


clean: 
	rm *.o
